1. Technical Field
The present invention relates to an apparatus for graphics processing in general, and in particular to an apparatus for generating graphics images within a graphics system. Still more particularly, the present invention relates to a graphics adapter having a versatile lighting engine.
2. Description of the Prior Art
Three-dimensional (3-D) graphics scenes in a graphics system are typically made up of a number of polygons that are delimited by a set of vertices. Several vertices can be combined to form a primitive such as a square, a triangle, etc. Each individual vertex owns a set of attributes, such as: 1) a material color, which describes the color of an object to which the vertex belongs; 2) a normal, which describes the direction a surface is facing at that vertex; and 3) a position, which describes where the vertex is located. In addition, each graphics scene also has a set of attributes, such as: 1) an ambient light intensity; and 2) location and intensity of one or more individual light sources. One important task of a 3-D graphics system is to combine the vertex information that describes a surface (i.e., the material color, the normal, and the position) with the scene information (i.e., the ambient light intensity and the location and intensity of all light sources) in order to produce a color for an object that accurately portrays the appearance of the object.
When the attributes of all light sources and surfaces are known, the color of the object can be evaluated utilizing a lighting equation. With a lighting equation, colors of an object are generally computed on a vertex-by-vertex basis. Generally speaking, there are four components that contribute to the full lit color of a vertex, namely, emissive, ambient, diffuse, and specular.
A surface is assumed to emit light of a given color that radiates in all directions, if the material associated with the surface has an emissive component assigned to it. The contribution to the intensity at a vertex is the emissive component. Thus, the emissive component is generally utilized to model surfaces that give off light.
Ambient is a component of light whose reflection is constant off of all surfaces, regardless of the viewpoint or light source direction. Each graphics scene has an ambient color. The brightness of an image due to ambient light is determined by the ambient color of the graphics scene, the ambient intensity of each light source, and the ambient material color of the object.
Diffuse is the contribution of light that is reflected and scattered in all directions by an object, independent of the viewing direction.
Specular reflection has its brightest intensity along the direction of reflection. For example, a shiny surface such as a mirror or a steel ball will generate a very bright reflection, but only when viewed along the direction of reflection or close to it.
All four above-mentioned color components may be utilized during the computation of a lit color of a vertex. The present invention provides a graphics adapter having a versatile lighting engine that is capable of processing each vertex of a graphical object in an efficient manner.
In accordance with a preferred embodiment of the present invention, graphics objects in a graphics scene can be generated by a graphics adapter. Each of the graphics objects within the graphics scene is made up of a number of polygons that are delimited by a set of vertices. The graphics adapter includes a graphics pipeline and a control module. In response to attributes received from a graphics software application, the control module selectively controls a frequency in which vertices are fed into the graphics pipeline and controls a number of concurrent calculations that are performed on the vertices within the graphics pipeline.
All objects, features, and advantages of the present invention will become apparent in the following detailed written description.